<template>
    <div>
        <h3>商品评论</h3>
        <!-- 评论子组件区域 -->
        <comment-box :id="id"></comment-box>
    </div>
</template>

<script>
    import comment from '../subcomponents/comment.vue' 
    export default {
        data(){
            return{
                id:this.$route.params.id,//将url地址中传递的id值挂载到data上,方便调用
                photoinfo : {
                    title:"图片详情标题",
                    time:"2019-02-28 11:01:00",
                    click:0,
                    content:"<a ><span>勾践卧薪尝胆地</span></a>"
                }
            }
        },
        created(){
            // this.getPhotoInfo();
        },
        methods:{
            getPhotoInfo(){
                //获取图片数据
                this.$http.get('api/getimageInfo/'+this.id).then(result=>{
                    if(result.body.status == 0){
                        this.photoinfo = result.body.message[0];
                    }else{
                        Toast('获取新闻详情数据失败')
                    }
                })
            },
        },
        components:{//用来注册子组件的节点
             'comment-box':comment
        }
    }
</script>


<style lang="scss" scoped>
    
</style>

